package com.coocaa.ops.plus.core.third.magic.constant;

import lombok.experimental.UtilityClass;

/**
 * @author bjh
 * @description
 * @date 2021/1/19 11:34
 */
@UtilityClass
public class PosterMergeConstants {
    /**
     * 二等分推荐位宽度
     */
    public static final Integer BISECTION_WIDTH = 860;
    /**
     * 三等分推荐位宽度
     */
    public static final Integer TRISECTION_WIDTH = 560;
    /**
     * 二等分推荐位标题字体大小
     */
    public static final Integer TITLE_FONT_SIZE_BISECTION = 40;
    /**
     * 三等分推荐位标题字体大小
     */
    public static final Integer TITLE_FONT_SIZE_TRISECTION = 36;
    /**
     * 二等分推荐位标题副标题的间距
     */
    public static final Integer[] TITLE_SUB_TITLE_GAP_BISECTION = new Integer[]{0, 16};
    /**
     * 三等分推荐位标题副标题的间距
     */
    public static final Integer[] TITLE_SUB_TITLE_GAP_TRISECTION = new Integer[]{0, 12};
    /**
     * 标题透明度
     */
    public static final Float OPACITY_TITLE = 0.9f;
    /**
     * 副标题的透明度
     */
    public static final Float OPACITY_SUB_TITLE= 0.8f;

    public static Integer getTitleTextSize(Integer blockWidth) {
        if (blockWidth <= TRISECTION_WIDTH) {
            return TITLE_FONT_SIZE_TRISECTION;
        }
        return TITLE_FONT_SIZE_BISECTION;
    }

    public static Integer[] getTitleSubTitleGap(Integer blockWidth) {
        if (blockWidth <= TRISECTION_WIDTH) {
            return TITLE_SUB_TITLE_GAP_TRISECTION;
        }
        return TITLE_SUB_TITLE_GAP_BISECTION;
    }
}
